﻿<%@ Page Language="C#" MasterPageFile="~/admin/Admin.master" AutoEventWireup="true"
    CodeFile="AddProduct.aspx.cs" Inherits="admin_AddProduct" Title="Untitled Page" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <title>Add Product</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderContent" runat="Server">
    <table style="width: 100%;" cellspacing="5">
        <tr>
            <td style="width: 150px">
                <asp:Label ID="Label2" runat="server" Text="Select Category"></asp:Label>
            </td>
            <td>
                <asp:DropDownList ID="DropDownListCategory" runat="server" DataValueField="cat_name"
                    Width="210px">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Label1" runat="server" Text="Product Name"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtProductName" runat="server" Width="207px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="validateProductName" runat="server" 
                    ControlToValidate="txtProductName" Display="None" 
                    ErrorMessage="Please enter Product Name" SetFocusOnError="True"></asp:RequiredFieldValidator>
                <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" 
                    HighlightCssClass="validatorCalloutHighlight" 
                    TargetControlID="validateProductName">
                </asp:ValidatorCalloutExtender>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Label3" runat="server" Text="Description"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine" 
                    Width="207px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="validateDescription" runat="server" 
                    ControlToValidate="txtDescription" Display="None" 
                    ErrorMessage="Please enter Description" SetFocusOnError="True"></asp:RequiredFieldValidator>
                <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" 
                    HighlightCssClass="validatorCalloutHighlight" 
                    TargetControlID="validateDescription">
                </asp:ValidatorCalloutExtender>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Label4" runat="server" Text="Quantity"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtQuantity" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="validateQuantity" runat="server" 
                    ControlToValidate="txtQuantity" Display="None" 
                    ErrorMessage="Please enter Quantity" SetFocusOnError="True"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="regexQuantity" runat="server" 
                    ControlToValidate="txtQuantity" Display="None" 
                    ErrorMessage="Please enter only number" SetFocusOnError="True" 
                    ValidationExpression="\d*"></asp:RegularExpressionValidator>
                <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" 
                    TargetControlID="validateQuantity" 
                    HighlightCssClass="validatorCalloutHighlight">
                </asp:ValidatorCalloutExtender>
                <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" 
                    TargetControlID="regexQuantity" 
                    HighlightCssClass="validatorCalloutHighlight">
                </asp:ValidatorCalloutExtender>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Label5" runat="server" Text="Price"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtPrice" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="validatePrice" runat="server" 
                    ControlToValidate="txtPrice" Display="None" ErrorMessage="Please enter Price" 
                    SetFocusOnError="True"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="regexPrice" runat="server" 
                    ErrorMessage="Enter only number or float number" ControlToValidate="txtPrice" 
                    SetFocusOnError="True" ValidationExpression="[0-9]*(\.[0-9]{1,2})?" 
                    Display="None"></asp:RegularExpressionValidator>
                <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server" 
                    HighlightCssClass="validatorCalloutHighlight" TargetControlID="validatePrice">
                </asp:ValidatorCalloutExtender>
                <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender6" runat="server" 
                    HighlightCssClass="validatorCalloutHighlight" TargetControlID="regexPrice">
                </asp:ValidatorCalloutExtender>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="LabelImg" runat="server" Text="Image"></asp:Label>
            </td>
            <td>
                <asp:FileUpload ID="FileUploadImageProduct" runat="server" />
                <asp:RequiredFieldValidator ID="validateFileUploadImg" runat="server" 
                    Display="None" ErrorMessage="Please select browse file image" 
                    SetFocusOnError="True" ControlToValidate="FileUploadImageProduct"></asp:RequiredFieldValidator>
                <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender7" runat="server" 
                    HighlightCssClass="validatorCalloutHighlight" 
                    TargetControlID="validateFileUploadImg">
                </asp:ValidatorCalloutExtender>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                <asp:Button ID="btnAddProduct" runat="server" Text="Add Product" 
                    onclick="btnAddProduct_Click" />
            </td>
        </tr>
    </table>
</asp:Content>
